<!-- #include virtual="/Inc/conn.asp"-->
<!-- #include virtual="/Inc/md5.asp"-->
<!-- #include virtual="/Inc/function.asp"-->
<!-- #include virtual="/Inc/config.asp"-->
<!-- #include virtual="/Inc/Admin/common.asp"-->
<!-- #include virtual="/Inc/file.asp"-->
<%
'**************************************************************
' Software name: KnifeCMS
' Web: http://www.knifecms.com
' Copyright (C) 2007－2012 小刀出品 版权所有
'**************************************************************
if Trim(Request("title"))="" then
	FoundErr=True
	Message=Message & "<li>标题不能为空！</li>"
end if
Dim tplcss
Dim css:css=trim(request("css"))

if FoundErr<>True then
	Dim cnDocID
	cnDocID=clng(Request("ID"))
	Set cmdTemp = Server.CreateObject("ADODB.Command")
	Set InsertCursor = Server.CreateObject("ADODB.Recordset")
	cmdTemp.CommandText = "SELECT * FROM db_tplstyle WHERE ID="&cnDocID
	cmdTemp.CommandType = 1
	Set cmdTemp.ActiveConnection = conn
	InsertCursor.Open cmdTemp, , 1, 3
	InsertCursor("title") = trim(request("title"))
	InsertCursor("description") = trim(request("description"))
	InsertCursor("css") = css
	InsertCursor.Update
	'temp = InsertCursor.bookmark
	'InsertCursor.bookmark = temp
	'cnDocID = InsertCursor("id")
	InsertCursor.close
	Set cmdTemp = nothing
	Set InsertCursor = nothing
	
	Call SaveFile_Stream("/Admin/portal/css/style" & cnDocID & ".css",css)
	
	conn.close
	Set conn = nothing
	
	'生成样式
	'tplcss=LoadFile_Stream("/Admin/portal/css/style" & styleID & ".css")
	tplcss=Replace(css,"cursor:move;","")
	tplcss=Replace(tplcss,".moduleHeader:hover","")
	Call SaveFile_Stream("/Templates/default/css/style" & cnDocID & ".css",tplcss)
	
	'成功提示
	call performMsg("操作成功！","")
end if
if FoundErr=True then
	call ErrMsg(Message)
end if
%>